home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / lsof_3.37 / 00README < prev    next >
Encoding:
Text File  |  1995-08-01  |  33.2 KB  |  851 lines

  1.  
  2.             Making and Installing lsof 3
  3.  
  4. ********************************************************************
  5. | The latest release of lsof is always available via anonymous ftp |
  6. | from vic.cc.purdue.edu.  Look in pub/tools/unix/lsof.            |
  7. ********************************************************************
  8.  
  9.                 Contents
  10.  
  11.     Making Lsof
  12.         Security
  13.         Device Directory Access Warnings
  14.         NFS Blocks
  15.         Caches -- Name and Device
  16.         Raw Sockets
  17.         Other Compile-time Definitions
  18.         Field Output Example Scripts
  19.     Dialect Notes
  20.         AIX 3.2.[45], 4.1, and 4.1.[12]
  21.         EP/IX
  22.         FreeBSD
  23.         HP-UX 8.x, 9.x, and 10
  24.         IRIX 4.0.5H, 5.1.1, 5.2, 5.3, and 6.0
  25.         Linux
  26.         NetBSD 1.0 and 1.0A
  27.         NEXTSTEP 2.1 and 3.[0123]
  28.         Novell UnixWare 1.1, 1.1.1, and 1.1.2
  29.         OSF/1 1.3, 2.0, and 3.[02] for the DEC Alpha
  30.         Pyramid DC/OSx 1.1 for ES, Nile and S Series
  31.         RISC/os 4.52
  32.         SCO OpenDesktop or OpenServer 1.1, 3.0, and 5.0
  33.         Sequent PTX 2.1.[156] and 4.0.[23]
  34.         Solaris 2.[1234]
  35.         SunOS 4.1.[1234]
  36.             SunOS 4.1.x gcc Warning
  37.         Ultrix 2.2, 4.2, 4.3, and 4.4
  38.         V/88 R32V3, R40V4.2, and R40V4.3
  39.     Installing Lsof
  40.     Porting lsof 3 to a New Unix Dialect
  41.  
  42.  
  43. ===========
  44. Making Lsof
  45. ===========
  46.  
  47. This lsof distribution can be used with many Unix dialects.  However,
  48. it must be configured specifically for each dialect.  Configuration
  49. is done with the Configure shell script in the top level of the
  50. distribution, cooperating with Mksrc shell scripts in the
  51. dialect-specific subdirectories.
  52.  
  53. Lsof may be configured for the following Unix dialects, using the
  54. named abbreviations -- e.g.,
  55.  
  56.     $ Configure solaris
  57.  
  58.         Dialect*
  59.  Abbreviation     Notes  Unix Dialect
  60.  ------------    ------  ------------
  61.  
  62.     aix            Yes     IBM AIX 3.2.[45], 4.1, and 4.1.[12]
  63.     dcosx        Yes     Pyramid DC/OSx 1.1 for ES, Nile and S series
  64.     decosf        Yes     DEC OSF/1 1.3, 2.0, 3.0, and 3.2
  65.     dynix         Purdue Dynix 3.0.12
  66.     dynix3012         Sequent Dynix 3.0.12
  67.     dynix31         Sequent Dynix 3.1
  68.     epix211        Yes     EP/IX 2.1.1 for the CDC 4680
  69.     freebsd        Yes     FreeBSD 1.1.5.1, 2.0, and 2.0.5
  70.     hpux        Yes     HP-UX 8.x, 9.x, and 10
  71.     irix        Yes     SGI IRIX 4.0.5H, 5.2, 5.3, and 6.0
  72.     netbsd        Yes  NetBSD 1.0 and 1.0A
  73.     linux        Yes     Linux through 1.2.11
  74.     next3        Yes     NEXTSTEP 2.1 and 3.[0123], all architectures
  75.     ptx            Yes     Sequent PTX 2.1.[156] and 4.0.[23]
  76.     riscos        Yes  RISC/os 4.52 for MIPS R2000-based systems
  77.     sco            Yes     SCO OpenDesktop or OpenServer, 1.1, 3.0,
  78.              and 5.0
  79.     solaris        Yes     Solaris 2.[1234], using gcc
  80.     solariscc        Yes     Solaris 2.[1234], using Sun's cc
  81.     sunos413        Yes     SunOS 4.1.[1234], using gcc
  82.     sunos413cc        Yes     SunOS 4.1.[1234], using Sun's cc
  83.     ultrix22        Yes     Purdue version of Ultrix 2.2
  84.     ultrix        Yes     Ultrix 4.2, 4.3, and 4.3 for DEC RISC and VAX
  85.     uw11        Yes     Novell UnixWare 1.1, 1.1.1, and 1.1.2
  86.     uw11nonet        Yes     Novell UnixWare 1.1, 1.1.1, and 1.1.2
  87.              without TCP/IP network packages
  88.     v88            Yes  V/88 R32V3, R40V4.2, and R40V4.3 for Motorola
  89.              M88K
  90.  
  91. (* -- Look in the Dialect Notes section for more information on
  92.       the lsof revision for this dialect.)
  93.  
  94. If you have an earlier version of a Unix dialect named in this
  95. list, lsof may work on your system.  I have no way of testing that
  96. myself.  Try configuring for the named dialect -- e.g., if you're
  97. using Solaris 2.1, try configuring for Solaris 2.3.
  98.  
  99. After you have configured lsof for your Unix dialect, use the make
  100. command to build it -- e.g.,
  101.  
  102.     $ make
  103.  
  104.  
  105. Security
  106. ========
  107.  
  108. If the symbol HASSECURITY is defined, a security mode is enabled,
  109. and lsof will allow only the root user to list all open files.
  110. Non-root users may list only open files whose processes have the
  111. same user ID as the real user ID of the lsof process (the one that
  112. its user logged on with).
  113.  
  114. Lsof is distributed with the security mode disabled -- HASSECURITY
  115. is not defined.  You can enable the security mode by defining
  116. HASSECURITY in the Makefile or in the machine.h header file for
  117. the specific dialect you're using -- e.g. dialects/aix/machine.h.
  118.  
  119. Since lsof usually needs setgid permission to read /dev/mem or
  120. /dev/kmem, and needs setuid root permission to read /proc file
  121. system entries, its security should always be viewed with skepticism.
  122. Lest the setgid and setuid modes permit lsof to read kernel name
  123. list or memory files, declared with the -c and -k options, that
  124. the lsof user can't normally access, lsof uses access(2) to establish
  125. its real user's authority to read such files.  This change was
  126. added in revision 3.07 at the suggestion of Tim Ramsey <tar@ksu.ksu.edu>.
  127.  
  128. In the end you must judge for yourself and your installation the
  129. risks that lsof presents and restrict access to it according to
  130. your circumstances.
  131.  
  132.  
  133. Device Directory Access Warnings
  134. ================================
  135.  
  136. When lsof encounters a /dev (or /device) directory or one of its
  137. subdirectories that it cannot access with opendir(3), it issues a
  138. warning message and continues.  The lsof caller can inhibit the
  139. warning with the -w option.
  140.  
  141. The lsof builder can inhibit the warning by disabling the definition
  142. of WARNDEVACCESS in the dialect's machine.h.  WARNDEVACCESS is
  143. defined by default for most dialects.  However, some dialects have
  144. some device subdirectories that are private -- e.g., HP-UX -- and
  145. it is more convenient for the lsof user if warning messages about
  146. them are inhibited.
  147.  
  148. Output from lsof's -h option indicates the status of WARNDEVACCESS.
  149. If it was defined when lsof was compiled, this message will appear:
  150.  
  151.     Warnings are enabled for inaccessible device directories.
  152.  
  153. If WARNDEVACCESS was not defined when lsof was compiled, this
  154. message will appear instead:
  155.  
  156.     Warnings are disabled for inaccessible device directories
  157.  
  158.  
  159. NFS Blocks
  160. ==========
  161.  
  162. Lsof is susceptible to NFS blocks when it tries to lstat() mounted
  163. file systems and when it does further processing -- lstat() and
  164. readlink() -- on its optional file and file system arguments.
  165.  
  166. Lsof tries to avoid being stopped completely by NFS blocks by doing
  167. the lstat() and readlink() functions in a child process, which
  168. returns the function response via a pipe.  The lsof parent limits
  169. the wait for data to arrive in the pipe with a SIGALRM, and, if
  170. the alarm trips, terminates the child process with a SIGINT and a
  171. SIGKILL.
  172.  
  173. This is as reliable and portable a method for breaking NFS deadlocks
  174. as I have found, although it still fails under some combinations
  175. of NFS version, Unix dialect, and NFS file system mount options.
  176. It generally succeeds when the "intr" or "soft" mount options are
  177. used; it generally fails when the "hard" mount option is used.
  178.  
  179. When lsof cannot kill the child process, a second timeout causes
  180. it to stop waiting for the killed child to complete.  While the
  181. second timeout allows lsof to complete, it may leave behind a hung
  182. child process.  Unless told to be terse, lsof warns about the
  183. possible hung child.
  184.  
  185. The NFS block handling was updated at revisions 3.17 and 3.18 from
  186. suggestions made by Andreas Stolcke <stolcke@ICSI.Berkeley.EDU>.
  187. Andreas suggested using the alternate device numbers that appear
  188. in the mount tables of some dialects when it is not possible to
  189. stat(2) the mount points.  Lsof 3.17 does this.
  190.  
  191. The -b option was added at lsof 3.18 to direct it to avoid the
  192. stat(2) and readlink(2) calls that might block on NFS mount points
  193. and always use the alternate device numbers.  Consequently, if
  194. you're running lsof 3.18 or later, you can avoid kernel blocks
  195. altogether by using the -b option.  If you don't want warning
  196. messages about what lsof is doing, use the -w option, too.
  197.  
  198.  
  199. Caches -- Name and Device
  200. ==========================
  201.  
  202. Robert Ehrlich <Robert.Ehrlich@inria.fr> suggested that lsof obtain
  203. path name components for open files from the kernel's name cache.
  204. Where possible, lsof revisions 3.19 and later do this.  The -C
  205. option inhibits kernel name cache examination.
  206.  
  207. Robert also suggested that lsof cache the information it obtains
  208. via stat(2) for nodes in /dev to reduce subsequent running time.
  209. Lsof revisions 3.19 and later do this.  The -D option controls the
  210. handling of the device cache file.
  211.  
  212. Normally the device cache file is stored in /tmp/.lsof_dev_cache,
  213. mode 0666.  This allows any lsof call to build or rebuild it.  Lsof
  214. senses accidental or malicious damage to the file with extensive
  215. sanity checks, including the use of a 16 bit CRC.  It also tries
  216. to sense changes in the device directory (/dev, or /devices, or
  217. whatever) that indicate the device cache file is out of date by
  218. comparing the device cache file's mtime to the mtime and ctime of
  219. the device directory.
  220.  
  221. You can control the device cache feature by making changes to a
  222. dialect's machine.h, ddev.c, and Mksrc files.
  223.  
  224.  
  225. Raw Sockets
  226. ===========
  227.  
  228. On many Unix systems raw sockets use a separate network control
  229. block structure.  Display of files for applications using raw
  230. sockets -- ping, using ICMP, for example -- need special support
  231. for displaying their information.  This support is so dialect-specific
  232. and information to provide it so difficult to find that not all
  233. dialect revisions of lsof handle raw sockets completely.
  234.  
  235.  
  236. Other Compile-time Definitions
  237. ==============================
  238.  
  239. The machine.h and dlsof.h header files for each dialect contains
  240. definitions that affect the compilation of lsof.  Check the
  241. Definitions That Affect Compilation section of the 00PORTING file
  242. of the lsof distribution for their descriptions.
  243.  
  244.  
  245. Field Output Example Scripts
  246. ============================
  247.  
  248. Example AWK and Perl 4 or 5 scripts for post-processing lsof field
  249. output are locate in the scripts subdirectory of the lsof distribution.
  250. The scripts subdirectory contains a 00README file with information
  251. about the scripts.
  252.  
  253.  
  254. =============
  255. Dialect Notes
  256. =============
  257.  
  258.  
  259. AIX 3.2.[45], 4.1, and 4.1.[12]
  260. ===============================
  261.  
  262. Specify the aix Configure abbreviation for AIX 3.2.[45], 4.1, and
  263. 4.1.[12].  The Configure script uses /usr/bin/oslevel to determine
  264. the AIX version.  If /usr/bin/oslevel isn't executable, the Configure
  265. script issues a warning message and assumes the version is 3.2.0.
  266. If you have an AIX version earlier than 3.2.0, you will have to
  267. edit the Makefile, produced by Configure, and change the value of
  268. the _AIXV definition in the CFGF string.
  269.  
  270. As of revision 3.29 lsof by default avoids using the kernel's
  271. readx() function, causing it to be unable to report information on
  272. some text and library file references.  The ``-X'' option was added
  273. to allow the lsof user to ask for the information readx() supplies.
  274.  
  275. Lsof avoids readx() to avoid the possibility of triggering a kernel
  276. problem, known as the Stale Segment ID kernel bug.  Kevin Ruderman
  277. <rudi@acs.bu.edu> reported this bug to me.  The bug shows up when
  278. the kernel's dir_search() function hangs, hanging the application
  279. process that called it so completely that the application process
  280. can neither be killed nor stopped.  The hang is the consequence of
  281. another process (e.g., lsof) making legitimate use of the kernel's
  282. readx() function to access the kernel memory that dir_search() is
  283. examining.  IBM has indicated they have no plans to fix the bug in
  284. 3.2.x or 4.1[.x] but may fix it in 4.2.
  285.  
  286. A fuller discussion of this bug may be found in the 00FAQ file of
  287. this distribution.  Sections 3.6.2 and 3.6.2.1 describe the Stale
  288. Segment ID bug, the APAR on it, and the sequence of events that
  289. exposes it.
  290.  
  291. I added the ``-X'' function so you can tell lsof to use readx(),
  292. but if you use ``-X'', you should be alert to its possibly serious
  293. side effects.  Although readx() is normally disabled, its state is
  294. controlled with the HASXOPT and HASXOPT_VALUE definitions in
  295. dialects/aix/machine.h, and you can change its default state by
  296. changing those definitions.
  297.  
  298. You can also compile lsof with readx() use permanently enabled or
  299. disabled -- see the comments about the definitions in the
  300. dialects/aix/machine.h header file.  You may want to permanently
  301. disable lsof's use of readx() if you plan to make lsof publicly
  302. executable.
  303.  
  304. I have never seen lsof cause the Stale Segment ID bug occur and
  305. haven't had a report that it has, but I believe there is a possibility
  306. it could.
  307.  
  308. Mark Peek <mark_peek@taligent.com> provided and tested the changes
  309. for IBM's AIX 4.1.
  310.  
  311.  
  312. EP/IX
  313. =====
  314.  
  315. The EP/IX port would not have been possible without the help of
  316. Doug Eldred of CDC.
  317.  
  318. There is no /proc file system support in EP/IX 2.1.1, even though
  319. it's a SYSV R4 derivative.  As now configured, lsof must compile
  320. in the svr3 environment, but /proc file system support needs
  321. functions and header files from the svr4 environment.  I have not
  322. succeeded in mixing the two environments.
  323.  
  324.  
  325. FreeBSD
  326. =======
  327.  
  328. Bill Bormann of the Purdue University Computing Center provided a
  329. FreeBSD 1.1.5.1 test system.
  330.  
  331. Kurt Jaeger <pi@complx.stgt.sub.org> helped with the FreeBSD 2.0
  332. update.  Ade Barkah <mbarkah@rksys.com> and William McVey
  333. <wam@cs.purdue.edu> provided FreeBSD 2.0 test systems.  Ade provided
  334. the FreeBSD 2.0.5 test system.
  335.  
  336. The FreeBSD distribution header files are augmented by header files
  337. in the dialects/freebsd/include directory tree.  The tree includes
  338. separate sub-trees for FreeBSD 1.1.5.1 (dialects/freebsd/include/1)
  339. and 2.0 (dialects/freebsd/include/2).
  340.  
  341. The two sub-trees contain header files that may not always be
  342. present in a FreeBSD system, or that need special modifications.
  343. The modifications consist of #if/#endif brackets, using the definition
  344. LSOF, to eliminate or alter troublesome header file items.  The
  345. LSOF definition is made in the CDEFS string of the Makefile.
  346.  
  347. Configuring lsof 3 for FreeBSD, using lsof's Configure script, may
  348. require specification of the name of the file in / that contains
  349. kernel name list (symbol to address) information.  The Configure
  350. script assumes that the file is named /386bsd for FreeBSD 1.1.5.1;
  351. and gets the FreeBSD 2.0 name via sysctl(8).  If the FreeBSD 2.0
  352. sysctl doesn't yield a kernel name, lsof uses  a default of /kernel.
  353.  
  354. After defining the default kernel file name, lsof tests it to make
  355. sure it's a plain, executable file.  If it is not, Configure will
  356. ``ls -CF'' the contents of / and ask that the Configure user specify
  357. the name of the kernel name list file.  Whatever is specified must
  358. be a plain, executable file.
  359.  
  360.  
  361. HP-UX 8.x, 9.x, and 10
  362. ======================
  363.  
  364. Lsof has been tested under some versions of HP-UX 8.x, 9.x, and 10
  365. on some HP hardware platforms.
  366.  
  367. To use the CCITT x.25 socket support for HP-UX, you must have the
  368. x.25 header files in /etc/conf/x25
  369.  
  370. Pasi Kaara <ppk@atk.tpo.fi> helped with the HP-UX port, especially
  371. with its CCITT x.25 socket support.
  372.  
  373. Richard Allen <ra@rhi.hi.is> provided a test system and helped with
  374. the HP-UX 10 port.
  375.  
  376.  
  377. IRIX 4.0.5H, 5.1.1, 5.2, 5.3, and 6.0
  378. =====================================
  379.  
  380. Adam Hammer of Purdue's Computer Science Department, Dwight McKay
  381. of Purdue's Biology Department, and Dave Olson of Silicon Graphics
  382. kindly assisted with the IRIX ports.  Przemek Klosowski
  383. <przemek@rrdjazz.nist.gov> provided an IRIX 6.0 test system.
  384.  
  385. I currently don't have access to IRIX 5.1.1, so lsof 3 has not been
  386. tested on it.  Because there are some differences between 5.1.1
  387. and 5.2 in the kernel structures that lsof uses, I'm not sure the
  388. IRIX 5.2 revisions will work on 5.1.1.
  389.  
  390. Dave Olson <olson@anchor.engr.sgi.com> supplied the IRIX 5.3 changes.
  391. Dave says IRIX 5.3 lsof doesn't work with the new XFS file system,
  392. because of kernel data structure definitions.
  393.  
  394. The CFLAGS string, the clean rule, the depend rule, and the disabled
  395. sinclude make directive have traces of a dependency technique that
  396. uses the -MDupdate flag of the IRIX cc compiler.  Unfortunately I
  397. have encountered two IRIX dialects -- a 4.0.5H system, and a 5.2
  398. one -- where the use of -MDupdate hung the compiler and the OS.
  399. Therefore, I have disabled the use of -MDupdate, but have left
  400. enough traces that the brave can re-enable it.
  401.  
  402. If you are brave and want to use compiler dependency generation,
  403. re-enable it by defining the CFGD string for the compiler option
  404. (e.g., CFGD=-MDupdate), and the CFGDN string for the name of the
  405. dependency file (e.g., CFGDN=-Makedepend.irix) in the Configure
  406. script or in the Makefile it constructs.  Remove the leading
  407. comment character (`#') from the Makefile's sinclude directive.
  408.  
  409. IRIX 5.x and 6.0 ship without some important system header files.
  410. They are found in the irix5hdr and irix6hdr subdirectories.
  411.  
  412. The last lsof revision I could test under 4.0.5H was 3.19.
  413.  
  414. The last lsof revision I could test under 5.2 was 3.18.
  415.  
  416.  
  417. Linux
  418. =====
  419.  
  420. With the help of Tim Korb <jtk@arthur.cs.purdue.edu>, who provided
  421. access to a Linux PC in the Purdue Computer Science Department, I
  422. first ported lsof to Linux version 1.0.9.  Subsequently I adapted
  423. that port to Yggdrasil Plug-and-Play Linux, Fall '94, version
  424. 1.1.47.
  425.  
  426. Hendrik G. Seliger <hank@Blimp.automat.uni-essen.de> reports that
  427. lsof compiles and seems to work under Linux 1.1.61.
  428.  
  429. The revision 3.20 changes appear to be necessary for Linux 1.1.75
  430. and above, although I have no confirmation of that.  If you learn
  431. differently, please let me know.
  432.  
  433. Marty Leisner <leisner@sdsp.mc.xerox.com> reports that lsof compiles
  434. and seems to work under Linux 1.1.64.  With the changes at lsof
  435. revision 3.20, it seems to compile and work under Linux 1.1.88,
  436. Marty reports.  Marty further reports that lsof 3.25 compiles and
  437. works under Linux 1.2.5; and lsof 3.29 under 1.2.8.
  438.  
  439. At revision 3.32 Michael Shields <shields@tembel.org> helped add
  440. and test automatic handling of ELF/COFF form names in /System.map,
  441. and Joseph J. Nuspl Jr. <nuspl@nvwls.cc.purdue.edu> gave me access
  442. to his Linux system for testing.  Michael's testing and mine on
  443. Joe's system were done against Linux version 1.2.10.  Subseuqently
  444. I have tested lsof 3.37 under Linux 1.2.11.
  445.  
  446. The 00FAQ file gives some Linux tips.
  447.  
  448.  
  449. NetBSD 1.0 and 1.0A
  450. ===================
  451.  
  452. Greg Earle <earle@isolar.Tujunga.CA.US> and Paul Kranenburg
  453. <pk@cs.few.eur.nl> assisted me with NetBSD 1.0 and 1.0A.  Greg
  454. provided modifications to the NetBSD code that was once in lsof,
  455. and helped test the revised code; Paul generously provided Intel
  456. and SPARC-based test systems.
  457.  
  458. The NetBSD 0.9 support that was in lsof revisions 3.0 through 3.20,
  459. but tested last in 3.0, has been removed.
  460.  
  461.  
  462. NEXTSTEP 2.1 and 3.[0123]
  463. =========================
  464.  
  465. Virtual memory header files that allow lsof to display text references
  466. were derived from the contents of /usr/include/vm of NEXTSTEP 2.0.
  467. NeXT did not ship the virtual memory header files with other NEXTSTEP
  468. versions.
  469.  
  470. You may use the RC_FLAGS environment variable to declare compiler
  471. options outside the Makefile.  A common use of this variable is to
  472. define the architecture types to be included in a "fat" executable.
  473. See the comments in dialects/next/Makefile for an example.
  474.  
  475. Stuart Staniford-Chen <stanifor@cs.ucdavis.edu> reports that lsof
  476. 3 builds and works under NEXTSTEP 3.0.
  477.  
  478. Andreas Stolcke <stolcke@ICSI.Berkeley.EDU> reports that lsof 3.09
  479. builds and works under NEXTSTEP 2.1, if ``-DKERNEL_FEATURES'' is
  480. added to the compiler flags in the Makefile.
  481.  
  482. Allan Nathanson <ajn@NeXT.com> supplied the update in lsof 3.23
  483. for NEXTSTEP 3.3 (m68k, i486, hppa, and SPARC architectures).
  484.  
  485.  
  486. Novell UnixWare 1.1, 1.1.1, and 1.1.2
  487. =====================================
  488.  
  489. The UnixWare version was developed on a PC with UnixWare 1.1.2,
  490. the SDK kit, and all TCP/IP network packages (including NFS)
  491. installed.  I have tried to include the header files from the TCP/IP
  492. network packages that lsof needs in the dialects/uw11 subdirectory.
  493. If you don't have the required TCP/IP packages you can still build
  494. lsof by configuring with the uw11nonet abbreviation.  (Of course,
  495. you must have the SDK package to build lsof.)
  496.  
  497. Peter Lord <plord@novell.co.uk> graciously provided a copy of
  498. UnixWare and technical help for the UnixWare port.  Peter has made
  499. the lsof distribution, including an lsof executable, available on
  500. the Novell mail server and a Novell anonymous ftp site.  To obtain
  501. lsof via the Novell server, compose and send the following electronic
  502. mail:
  503.  
  504.     To: mail-server@novell.co.uk
  505.     Subject:
  506.  
  507.     begin
  508.     send index
  509.     send BINARIES/lsof_3.08/lsof_3.08.tar.gz
  510.     send SOURCES/lsof_3.08.tar.gz
  511.     end
  512.  
  513. You may use anonymous ftp to ftp.novell.de to get these files:
  514.  
  515.     /pub/unixware/usle/BINARIES/lsof_3.08/lsof_3.08.tar.gz
  516.     /pub/unixware/usle/SOURCES/lsof_3.08.tar.gz
  517.  
  518. If you can't manage to get a UnixWare binary from these sources,
  519. send me email <abe@cc.purdue.edu>.
  520.  
  521.  
  522.  
  523. OSF/1 1.3, 2.0, and 3.[02] for the DEC Alpha
  524. ============================================
  525.  
  526. Lsof 3 has been tested under OSF/1 1.3, 2.0, 3.0, and 3.2 for the
  527. DEC Alpha.
  528.  
  529. As distributed, the kernel header files for OSF/1 1.3, 2.0, 3.0,
  530. and 3.2 are not wholly suited to lsof, because some of them are
  531. not designed to be included in user application programs.
  532.  
  533. Lsof circumvents the problems with three strategies: 1) defining
  534. header file directory search order with the C pre-processor -I
  535. option; 2) removing some symbol definitions in lsof.h; and 3)
  536. including slightly modified copies of header files in the dec_a/1,
  537. dec_a/2, dec_a/3, and dec_a/3.2 subdirectories of the distribution.
  538.  
  539. The modifications consist of #if/#endif brackets, using the definition
  540. LSOF, to eliminate or alter troublesome header file items.  The
  541. LSOF definition is made in the CDEFS string of the Makefile.
  542.  
  543. Lsof 3 also supports the ADVFS/MSFS layered file system product.
  544. It has been tested on a 1.3a system, kindly provided by Achim Bohnet
  545. <ach@mpe-garching.mpg.de> and Bernt Christandl <beb@mpe-garching.mpg.de>,
  546. and a 3.0 system kindly provided by Ron Young <ron@screamer.nevada.edu>.
  547. (It has not been tested under OSF/1 1.2 or 2.0.)  Lsof can locate
  548. all the open files of an ADVFS/MSFS file system when its path is
  549. specified, provided the file system is listed in /etc/fstab with
  550. an ``advfs'' type.  (The /etc/fstab caveat does not apply to OSF/1
  551. 3.0.)
  552.  
  553. Dave Morrison <dmorriso@us.oracle.com> prepared the dec_a/3.2
  554. subdirectory.  He and Lawrence MacIntyre <lpz@nautique.epm.ornl.gov>
  555. did OSF/1 V3.2 testing
  556.  
  557. Configuring lsof 3 for DEC OSF/1, using lsof's Configure script,
  558. requires specification of the subdirectory of /sys that contains
  559. configuration header files for revisions of lsof 3.09 and higher.
  560. (The script prompts for the entry of the subdirectory name.)
  561. Usually the name is an upper case version of the first host name
  562. component -- e.g., TOMIS from tomis.bio.purdue.edu.
  563.  
  564. In addition to the people already mentioned, these people helped
  565. me with the OSF/1 porting efforts:  Alex Kreis, Anthony Baxter,
  566. Axel Clauberg, Claus Kalle, Dwight McKay, Jeffrey Mogul, and James
  567. Woodward.
  568.  
  569.  
  570. Pyramid DC/OSx 1.1 for ES, Nile and S Series
  571. ============================================
  572.  
  573. Anthony Shortland <Anthony.Shortland@FMR.com> produced the Pyramid
  574. DC/OSx 1.1 support, working from the Novell UnixWare sources.
  575. Anthony provides these notes:
  576.  
  577.     1.  The -lucb library is needed for the strcasecmp() function.
  578.  
  579.     2.  Strict ANSI compliance was dictated with the -Xa compiler
  580.     option.  The -DVIRTUAL_COLOR, -DJOLT, and -DR4000 compiler
  581.     flags are needed to influence system header file conformance.
  582.  
  583.     3.  Anthony tested DC/OSx lsof on the file system types
  584.     available to him.  Your fstinfo(1M) may show other types
  585.     for which there is no support.
  586.  
  587. Anthony did his work on a Nile (R4400) series machine under DC/OSx
  588. 1.1-94d079.
  589.  
  590. Robert Vernon <bob@pyramid.com.au> provided changes to extend
  591. support to the ES and S (R3000) series machines and to the RxFS
  592. file system type.
  593.  
  594. The Configure script stanza for the dcosx abbreviation determines
  595. the machine hardware type and adjusts the compiler flags in the
  596. Makefile accordingly.
  597.  
  598. Bruce Beare <bjb@pyramid.com> helped enhance the distribution.
  599.  
  600. Robert Vernon reports that he tested his changes on: a Nile series,
  601. running DC/OSx 1.1-94d079; an S series, running DC/OSx 1.1-94c079
  602. with the RxFS option; and an ES series, running DC/OSx 1.1-93c063.
  603. He notes that to get lsof to compile on the out-of-date revision
  604. of DC/OSx (1.1-93c063) on the ES series machine, he had to "borrow"
  605. the mntent.h and mnttab.h header files from elsewhere.
  606.  
  607.  
  608. RISC/os 4.52
  609. ============
  610.  
  611. The RISC/os 4.52 R2030 test system was provided by Zdenko Tomasic
  612. <zdenko@harvey.cam.rice.edu>.
  613.  
  614.  
  615. SCO OpenDesktop or OpenServer 1.1, 3.0, and 5.0
  616. ===============================================
  617.  
  618. Dion Johnson <dionj@sco.com>, Bela Lubkin <belal@sco.com>, and
  619. Nathan Peterson <nathanp@sco.com> of SCO provided me copies of SCO
  620. OpenDesktop, version 3.0, and the SCO OpenDesktop Development
  621. System, version 3.0, and gave me technical advice for the lsof
  622. port.
  623.  
  624. Hugh Dickins <hughd@sco.COM>, Bela Lubkin, Craig B. Olofson
  625. <craigo@sco.COM>, and Nathan Peterson provided version 5.0 and gave
  626. technical advice for porting lsof 3.26 to it.
  627.  
  628. Lsof has been tested on SCO OpenDesktop or OpenServer releases
  629. 1.1, 3.0, and 5.0.  It should Configure without complaint, using
  630. the sco abbreviation, for release 2.0; and for SCO Unix release
  631. 3.2v2.0 through 3.2v5.0.0 with SCO TCP/IP and SCO NFS, but it has
  632. not been tested on them.  It will Configure, but complain, for
  633. releases 3.2.0 and 3.2.1.  It has not been tested and may not work
  634. with SCO stand-alone Unix systems that do not have TCP/IP and NFS
  635. support installed.
  636.  
  637. The <netdb.h> header file was accidentally omitted from some SCO
  638. Development System releases.  The Configure script will sense its
  639. absence and substitute an equivalent from the BSD distribution.
  640. The BSD <netdb.h> and the <sys/cdefs.h> header file it includes
  641. are located in the dialects/sco/include subdirectory tree.
  642.  
  643. The install rule places lsof in /bin and the lsof manual page in
  644. /usr/man/cat.LOCAL/lsof.LOCAL.  Change the Makefile in dialects/sco
  645. to suit your local conventions.
  646.  
  647.  
  648. Sequent PTX 2.1.[156] and 4.0.[23]
  649. ==================================
  650.  
  651. This distribution will build an lsof that I have tested on PTX
  652. 2.1.6 and 4.0.[23] systems.  Peter Jordan <petej@sequent.com>,
  653. Gerrit Huizenga <gerrit@sequent.com>, Kevin Smallwood <kcs@sequent.com>,
  654. and Mike Spitzer <mjs@sequent.com> provided access to the test
  655. systems and gave me technical advice.
  656.  
  657. Kevin Smallwood tested lsof under PTX 2.1.1.  Thomas A. Endo
  658. <tendo@netcom.com> and David Putz <PutzDW@PO1.LMB.unisys.com> tested
  659. under PTX 2.1.5.  Joel White <jdwhite@netcom.com> tested under PTX
  660. 2.1.6.  Bob Foertsch <foertsch@uiuc.edu> tested under PTX 4.
  661.  
  662. Lsof may not compile under all versions of PTX because of header
  663. file complications resulting from the absence of a particular
  664. layered product.  I have accommodated only the CD-ROM and NFS
  665. layered products in the lsof sources of revision 3.28.  If you have
  666. problems compiling lsof because your C compiler complains about
  667. missing header files, please email a description of your problems
  668. to me.
  669.  
  670.  
  671. Solaris 2.[1234]
  672. ================
  673.  
  674. The Solaris 2.3 revision of lsof 3 will probably work under Solaris
  675. 2.[12], but hasn't been tested there.
  676.  
  677. Lsof will compile with gcc and the Sun C compiler under Solaris.
  678. If you want to use the Sun compiler, use the solariscc Configure
  679. abbreviation.
  680.  
  681. Dave Curry <davy@ecn.purdue.edu> and Steve Kirsch <stk@infoseek.com>
  682. provided resources for the port.  Casper Dik <casper@fwi.uva.nl>
  683. and Gerry Singleton <Gerry.Singleton@Canada.Sun.COM> consulted and
  684. provided valuable assistance.
  685.  
  686. Casper Dik <casper@fwi.uva.nl> provided and tested the Solaris 2.4
  687. changes, including changes to the Configure script that allow it to
  688. sense and adjust to the Solaris version.  If you use gcc on Solaris,
  689. make sure the gcc-specific includes have been updated for 2.4.
  690.  
  691.  
  692. SunOS 4.1.[1234]
  693. ================
  694.  
  695. The distribution will build a usable lsof for SunOS 4.1.3.  It also
  696. will build distributions that usually work under SunOS 4.1.1 and
  697. 4.1.2.  (Steinar Haug <Steinar.Haug@runit.sintef.no> reports that
  698. it works for SunOS 4.1.4, too.)
  699.  
  700. To use lsof with SunOS versions below 4.1.3, configure for sunos413
  701. or sunos413cc.  If some inode numbers appear as zero in the lsof
  702. output on your system, try changing the SUNOSV value in the Makefile
  703. from 40103 to 40102.
  704.  
  705. To use lsof with SunOS 4.1.4, Configure for sunos413 (or sunos413cc).
  706.  
  707. You have two compiler choices -- gcc or cc.  Select the abbreviation
  708. that fits your system, sunos413 for gcc, or suns413cc for Sun cc.
  709. This hack is required because the Sun cc doesn't grok the const
  710. keyword.
  711.  
  712. It is also important to understand that a SunOS 4.1.x executable
  713. may only work for the architecture on which it is compiled.  For
  714. example, compiling lsof on a S690MP server produces a lsof that
  715. will only run on the server; that lsof won't run on the server's
  716. IPC clients.  To obtain a lsof that will run on the IPC clients,
  717. one must compile lsof on an IPC.
  718.  
  719. This awkward condition is a result of differences in the user
  720. structure (in <sys/user.h>) between Sun architectures.  Some standard
  721. Sun executables -- e.g., /bin/ps -- have the same problem.  Sun
  722. has "solved" the problem by symbolically linking them to
  723. architecture-specific executables in /usr/kvm.  Thus, /bin/ps
  724. becomes a symbolic link to /usr/kvm/ps.
  725.  
  726. Following this pattern, the SunOS Makefile for lsof installs the
  727. executable in /usr/kvm.  Our local Makefile has an install action
  728. that also creates a symbolic link to /usr/kvm/lsof from
  729. /usr/local/etc/lsof.  The supplied Makefile doesn't have that
  730. action, because it's local to our install program.  If you want a
  731. symbolic link to /usr/kvm/lsof from a place in your standard path,
  732. you'll have to add the appropriate action to the install rule.
  733.  
  734. You may not want to install lsof in /usr/kvm with a symbolic link
  735. from somewhere else.  In that case you might want to try a strategy
  736. suggested by Steinar Haug.  First, install the architecture-specific
  737. revisions of lsof in the place of your choice, each with a suffix
  738. matching the architecture value produced by the -m option of the
  739. uname command -- e.g., lsof.sun4, lsof.sun4c, lsof.sun4m.  Then,
  740. install the following shell script as lsof.
  741.  
  742.     #! /bin/sh
  743.     prog=$0.`uname -m`
  744.     exec $prog ${1+"$@"}
  745.  
  746.  
  747. SunOS 4.1.x gcc Warning
  748. =======================
  749.  
  750. There is a subtle gcc installation problem that may prevent you
  751. from building a working lsof on your SunOS 4.1.x system.  (It will
  752. prevent you from building a working ps, too, if you have sources.)
  753.  
  754. The problem deals with the header files that gcc "fixes" so they
  755. will be ANSI compliant.  There's a script in the gcc installation
  756. process, called fixincludes, that makes selected header files ANSI
  757. compliant by copying them from their Sun locations to a gcc library
  758. location.
  759.  
  760. Some of those header files change length, depending on the Sun
  761. architecture.  That length change affects the position of important
  762. elements from the user structure -- command name among them -- that
  763. lsof uses.
  764.  
  765. If header files are fixed on one architecture and copied to another --
  766. e.g., fixed on a sun4m and copied to a sun4c -- the destination
  767. architecture will have a gcc that works for many programs, but may
  768. fail for programs that reference the user structure.
  769.  
  770. The common manifestation of incorrect gcc header files is that lsof
  771. compiles properly, but doesn't report anything when it is run, no
  772. matter what option is used.  If this happens to you, examine the
  773. ancestry of your gcc compiler carefully.  Check the 00FAQ file for
  774. some suggested work-arounds.
  775.  
  776.  
  777. Ultrix 2.2, 4.2, 4.3, and 4.4
  778. =============================
  779.  
  780. Terry Friedrichsen <terry@venus.sunquest.com>, Dwight McKay
  781. <mckay@gimli.bio.purdue.edu>, and Jeffrey Mogul <mogul@pa.dec.com>
  782. helped me with this port.
  783.  
  784. The system to which the 2.2 port was directed has been extensively
  785. updated with 4.3BSD{Tahoe,Reno} network features, so it may not
  786. match a standard 2.2 system, if there is any such system still in
  787. use.  A separate Configure abbreviation, ultrix22, is necessary
  788. for it.
  789.  
  790. All other Ultrix versions may be configured with the ultrix
  791. abbreviation.
  792.  
  793. DECnet support was added to lsof at revision 3.05.  John Beacom
  794. <beacom@wisnud.physics.wisc.edu> kindly provided the test system.
  795. The Configure script decides that DECnet support is available if
  796. /usr/lib/libdnet.a and /usr/include/netdnet/dn.h exist and are
  797. readable.
  798.  
  799. Chris Timmons <skynyrd@tahoma.cwu.edu> reports that lsof 3.12
  800. compiles and works under Ultrix 4.4.
  801.  
  802.  
  803. V/88 R32V3, R40V4.2, and R40V4.3
  804. ================================
  805.  
  806. Chance Neale <cneale@panix.com> provided the V/88 test systems and
  807. Mike Feldman <feldman@charm.urbana.mcd.mot.com> provided technical
  808. information about V/88.  I thank them both.
  809.  
  810. The Configure script's v88 abbreviation figures out under which
  811. V/88 release it's running and adjusts the Makefile accordingly.
  812.  
  813.  
  814. ===============
  815. Installing Lsof
  816. ===============
  817.  
  818. Check the following Makefile strings before installing lsof:
  819.  
  820.     BIN        destination directory
  821.     GRP             group (probably needs to be the group that
  822.             can read /dev/kmem)
  823.  
  824. The install rule sets the mode to 2755 on the assumption that group
  825. read access to kernel memory files is sufficient.  If you use
  826. different access controls for the kernel memory files, you may have
  827. to change the install rule.  If you want lsof to be able to search
  828. for any file by specifying its name on the lsof call, regardless
  829. of the ownership or permissions of the file, you may also have to
  830. change the install rule to give lsof setuid-root permission.
  831.  
  832.  
  833. ====================================
  834. Porting lsof 3 to a New Unix Dialect
  835. ====================================
  836.  
  837. If you're brave enough to consider this (It _has_ been done; see
  838. the Pyramid DC/OSx support!), look at the 00PORTING file.  Please
  839. contact me before you start.  I might be able to help you or even
  840. do the port myself.
  841.  
  842. Don't overlook the contrib/ directory in pub/tools/unix/lsof on my
  843. ftp server, vic.cc.purdue.edu.  It contains user-contributed ports
  844. of lsof to dialects I don't distribute, because I can't test new
  845. revisions of lsof on them.
  846.  
  847.  
  848. Vic Abell <abe@cc.purdue.edu>
  849. Purdue University Computing Center (PUCC)
  850. July 26, 1995
  851.